Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-user is "delegate-my-device">

It allows to delegate a device.

Inputs

A JSON with these parameters:
id string
the nome of the device (you MUST have the ownership of the device)
contextbroker string
the contextbroker of the device
kind string
Kind of delegation. You can choose between READ_ACCESS,READ_WRITE, MODIFY and WRITE_ONLY.
usernamedelegated string
Username of the person to be delegated to view the device. It is recommended that you set one of the two delegations (user or group)
groupdelegated string
Group to be delegated to view the device. To delegate to a group, you must set cn=GROUP_NAME,ou=ORGANIZATION_NAME. It is recommended that you set one of the two delegations (user or group)

An example of the JSON array filled with correct data for user delegation:

{
"id": "nameDevice",
"usernamedelegated": "username",
"contextbroker": "contextbroker",
"kind": "READ_ACCESS"
}
    

An example of the JSON array filled with correct data for group delegation:

{
"id": "nameDevice",
"groupdelegated": "cn=GROUP_NAME,ou=ORGANIZATION_NAME",
"contextbroker": "contextbroker",
"kind": "READ_ACCESS"
}
    

Outputs

Returns an object containing the delegation

Details

The node can receive a JSON with the parameters described in the Inputs section and with them generate the output JSON. If the values are not present in the input JSON, these are read by those in the configuration. If they are not present in either part, an error is generated for the necessary parameters.